<?php
namespace App\Http\Controllers\Client\Talent;

use App\Http\Controllers\ClientController;
use App\Models\Talent;
use App\Models\Tools\AliOss;
use Illuminate\Support\Facades\DB;

class TalentListController extends ClientController
{

    /**
     * 我的（达人）认证
     */
    public function index()
    {
        // 已提交的达人信息
        $talent = Talent::getTalentMessage($this->we_id);

        // 查询当前用户信息
        $user = DB::table('lottery_users')->where('we_id','=',$this->we_id)->first();
        $user = json_decode(json_encode($user), true);

        return $this->setReturnJson(0,'success',[
            'talent' => $talent,
            'verified_phone' => $user['phone'] && true, // 是否已经绑定了手机号
            'notice' => $user['notice'] && true, // 是否接收发单的微信通知
        ]);

    }

}
